#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
int main()
{
	long long A, B, C, K;
	long long A1, B1, C1;
	int T = 0;
	cin >> T;
	for (int i = 0; i < T; i++)
	{
		cin >> A >> B >> C >> K;
		int sumA = B + C;
		int sumB = A + C;
		int sumC = A + B;
		for (int i = 0; i < K; i++)
		{
			A1 = (int)(sumA / 2);
			B1 = (int)(sumB / 2);
			C1 = (int)(sumC / 2);
			sumA = B1+C1;
			sumB = A1+C1;
			sumC = A1+B1;
		}
		cout << A1 << " " << B1 << " " << C1 << endl;
	}
	return 0;
}